# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
# SPDX-License-Identifier: MIT

import operator
from typing import Annotated

from langgraph.graph import MessagesState

from src.prompts.planner_model import Plan


class State(MessagesState):
    """State for the agent system, extends MessagesState with next field."""

    # Runtime Variables - 运行时变量
    locale: str = "en-US"                              # 系统使用的语言环境，默认为英语(美国)
    observations: list[str] = []                       # 存储观察结果的列表
    plan_iterations: int = 0                           # 计划迭代的次数计数器
    current_plan: Plan | str = None                    # 当前执行的计划，可以是Plan对象或字符串
    final_report: str = ""                             # 最终报告内容
    auto_accepted_plan: bool = False                   # 是否自动接受计划的标志
    enable_background_investigation: bool = True       # 是否启用背景调查的开关
    background_investigation_results: str = None       # 背景调查的结果存储
